package leetcode.easy;

import java.util.LinkedList;
import java.util.List;

/**
 * ClassName: $448_FindDisappearedNumbers
 * Description:
 * date: 2022-02-19 21:29
 *
 * @author liyifan
 */
public class $448_FindDisappearedNumbers {
    public List<Integer> findDisappearedNumbers(int[] nums) {
        int len = nums.length;
        List<Integer> res = new LinkedList<>();
        int[] help = new int[len + 1];

        for (int i = 0;i < len;i++) {
            help[i + 1] = nums[i];
        }

        for (int i = 0;i < len;i++) {
            help[nums[i] + 1] += len;
        }

        for (int i = 1;i <= len ;i++) {
            if (help[i] <= len) {
                res.add(i);
            }
        }
        return res;
    }
}
